package loengud.w03;

/**
 * Car object.
 * @author Ago
 *
 */
public class Car {

	/**
	 * Number of doors.
	 */
	int doors;
	
	/**
	 * Model name.
	 */
	String model;
	
	/**
	 * Maximum speed in km/h.
	 */
	int maxSpeed;
	
	
	/**
	 * Instance method to print out information about concrete car.
	 */
	public void printOut() {
		System.out.println(model + " " + doors + " " + maxSpeed);
		// we can modify static variables here
		carCount = 5;
	}
	
	/**
	 * Dummy method for driving.
	 */
	public void drive() {
		
	}

	/**
	 * A static variable which holds total number of cars.
	 * The value of this variable is the same for every car.
	 */
	static int carCount;
	
	/**
	 * Prints out static variable value, the number of cars.
	 */
	public static void printCarCount() {
		System.out.println("total no of cars:" + carCount);
		// here we can not use instance variables!
	}
	/*
	@Override
	public String toString() {
		return model + " " + doors + " " + maxSpeed;
	}*/

	@Override
	public String toString() {
		// TODO Auto-generated method stub (ctrl + space)
		return model + " " + doors + " " + maxSpeed;
	}
}
